#ifndef __MESSAGE_SERVER_H
#define __MESSAGE_SERVER_H

#include <cstdlib>
#include <iostream>
#include <boost\bind.hpp>
#include <boost\asio.hpp>
#include "Session.h"
#include <vector>

using namespace std;
using boost::asio::ip::tcp;

class MessageServer
{
private:
	boost::asio::io_service &ioService_;
	tcp::acceptor acceptor_;
	vector<pair<string, Message> > messages;

	void StartAccept();
	void HandleAccept(Session *newSession, const boost::system::error_code &error);

public:
	MessageServer(boost::asio::io_service &ioService, short port);
};

#endif